export const basicRoutes = [
  {
    name: '首页',
    path: '/',
    exact: true,
    icon: 'SettingFilled',
    component: '@/pages/index',
  },
  {
    name: '仪表盘',
    path: '/dashboard',
    icon: 'form',
    routes: [
      {
        name: '首页',
        path: '/dashboard/index',
        component: '@/pages/dashboard/index',
      },
    ]
  },
  {
    name: '用户',
    path: '/users',
    icon: 'form',
    component: '@/pages/users/index',
  },
  {
    name: '营销',
    path: '/marketings',
    icon: 'dashboard',
    component: '@/pages/marketings/index',
  },
  {
    name: '商品',
    path: '/goods',
    icon: 'dashboard',
    component: '@/pages/goods/index',
  },
  {
    component: '@/pages/404/index'
  }
];

const routes = [
  {
    path: '/login',
    name: '登录',
    icon: 'smile',
    component: '@/pages/login/index'
  },
  {
    path: '/register',
    name: '注册',
    component: '@/pages/register/index'
  },
  {
    path: '/',
    component: '@/layouts/index', // 指定以下页面的布局
    wrappers: ['@/components/authorized/index'],
    routes: [
      {
        path: '/',
        component: '@/layouts/BasicLayout',
        routes: basicRoutes
      },
      {
        component: '@/pages/404/index'
      }
    ]
  },
  {
    component: '@/pages/404/index'
  }
];

export default routes;
